package cn.shop.dys.bean;

import java.util.List;

/**
 * Created by Administrator on 2016/4/18.
 */
public class Cart implements CartDB {
    public int prodNum;
    public Product product;

    public Cart() {
    }

    @Override
    public String toString() {
        return "Cart{" +
                "prodNum=" + prodNum +
                ", product=" + product +
                '}';
    }

    @Override
    public int getId() {
        return product.id;
    }

    @Override
    public int getProdNum() {
        return prodNum;
    }

    @Override
    public List<ProductProperty> getProductProperty() {
        return product.productProperty;
    }

    public String getSendMessage() {
        String sendMessage = product.id + ":" + prodNum;
        int size = product.productProperty.size();
        if (product.productProperty != null) {
            sendMessage += ":";
            for (ProductProperty property : product.productProperty) {
              //  sendMessage += property.id + ",";
            }
            sendMessage.substring(0, sendMessage.length() - 1);
        }
        return sendMessage;

    }
}
